interface IResponse<T> {
    code: number
    message: string
    data: T
}

export function Ok<T>(res: any, data: T) {
    const response: IResponse<T> = { code: 200, message: '成功', data }
    res.send(response)
}

export function Fail (res: any, data: any) {
    const response: IResponse<any> = { code: 500, message: '失败', data }
    res.send(response)
}